[#ftl]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>[#assign module]article/${item.scope.id}/attachments[/#assign][#assign moduleName="附件"]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="${base}/commonjs/kindeditor/themes/default/default1.css" rel="stylesheet">
<title>添加新${moduleName}</title>
<script type="text/javascript" src="${base}/commonjs/jquery1.7.2/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="${base}/commonjs/jquery-forms.js"></script>
<script type="text/javascript" src="${base}/commonjs/jquery.select.js"></script>
<script type="text/javascript" src="${base}/commonjs/artDialog4/artDialog.source.js?skin=blue"></script>
<script type="text/javascript" src="${base}/commonjs/artDialog4/plugins/iframeTools.source.js"></script>
<script type="text/javascript">

</script>
</head>
<body>
<h3>附件上传</h3>
<form id="fileupload" action="${base}/${module}/upload" method="POST" enctype="multipart/form-data" target="_fui">
<input type="hidden" name="callback" value="setArticleImage">
<input type="hidden" name="id" value=${(item.id)!0}>
名称:<input type="text" name="name" value="${(item.name)!}"/><br>
[#if item.path?exists]
<a href="${base}/files/${item.path}">点此下载</a><br>
[/#if]
文件：<input type="file" name="file"><br>
描述:<textarea rows="3" cols="35" name="desc">${(item.description)!}</textarea><br><br>
<input type="button" value="保存附件" id="btadditem" onclick="uploadImage()">
</form>

<div style="position: absolute; width: 1px; height: 1px; left: -1000px; top: -1000px">
<iframe name="_fui"></iframe>
<script type="text/javascript">
function uploadImage(){
    $("#btadditem").attr("disabled", true);
    $("#fileupload").submit();
}
function setArticleImage(json){
	console.log(json);
    try{
       art.dialog.open.origin.flexGridReload(".flexme3");
    }catch(e){
       try{
           art.dialog.top.frames["_iframe"].window.flexGridReload(".flexme3");
       }catch(e){
           art.dialog.top.window.flexGridReload(".flexme3");
       }
    }
    art.dialog.close();
}
</script>
</div>

</body>
</html>